package com.edan.partnerback.common;

import cn.hutool.core.util.StrUtil;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Date;

public interface Constants {

    String USER_NAME_PREFIX = "partner_";   // 用户昵称前缀

    String DATE_RULE_YYYYMMDD = "yyyyMMdd";

    String LOGIN_USER_KEY = "userInfo";
    String FILE_DIR = "/files/";

    // 定义私钥和公钥
    String PRIVATEKEY = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAJ2HAj1a+zBPiBHvZ5HZuQYS+PE4KKxefxTOZ1+TLoM+M4ujlE5lnRU+Wk0qlACWRGaY7EN8X1SWjg9QenA4jlI6cgekUMC+3RZqLMOsPEkhJKCz0Ko3f+Io2sKPLT4D/bz8pbYS0WXL4ZXfMn4xy1stNakOiwQO8mRb29BoQVUlAgMBAAECgYAaRjF+cFVjOnC0pRy+O/VbaQCyoy5NiblijAa77z2b0F0illcfOF2Z9Ht1UXu8GVQxVKJbozv3TOFG9qJlY1mBY7sEMRZjoZxaJenHgPipgFDKfKkDDsgS0exSboAzdE0UX/RrU2VPwp3R7hvfxP8FhDMhLQOSp4Czj1Ejh1PDwQJBAOulEo1PBvePm4aI0LK5u2V+uLcXIrF0CVom9HeMTOBXuU2mkAaIXPi5fW9Z0d/G9i+GZWj3xd5sD554B3m6ZBECQQCrInzZ3i5ohhdHgOFSdC+0JZ46bHxDfA9IFT7upyYyRfRjxxNRDcd2Wr1EFGVipmZGGz5NwecRFlY8/Kv/YePVAkA04HvDPcKAdrcdf0HleQv2AHOOkiB01Wbr1eXxlYgCp2yrYf7bmGnUXjspa2xO3KSNkYjb/w1llbYDh0eWJx8hAkBOR9ZIamNcGIopgQCQkOkJRHPeUaV90Q/Eb0N8MyU7tdgWlAd3+g+VSehtbc76kxcRVoDnXJzvqgIEn6eliAeJAkAziPngjKClGdNtRqUI9EnAADWzGu3kZ2z9aPtQl8ZrHtcPOHXS9SrhfO8EqT8euOXLZBkmg1PJB5U7qiGoX48K";

    String PUBLICKEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdhwI9WvswT4gR72eR2bkGEvjxOCisXn8Uzmdfky6DPjOLo5ROZZ0VPlpNKpQAlkRmmOxDfF9Ulo4PUHpwOI5SOnIHpFDAvt0WaizDrDxJISSgs9CqN3/iKNrCjy0+A/28/KW2EtFly+GV3zJ+MctbLTWpDosEDvJkW9vQaEFVJQIDAQAB";


    String emailContext = "<div id=\"qm_con_body\"><div id=\"mailContentContainer\" onclick=\"getTop().previewContentImage(event, '')\" class=\"qmbox qm_con_body_content qqmail_webmail_only\"" +
            "                                 style=\"opacity: 1;\"><style>/* 邮件内部图片支持调起预览 */img[image-inside-content='1'] {cursor: pointer;}</style>                         " +
            "                                <p>用户，您好！</p>\n" +
            "                                <p>您正在【Partner】校园交友网（<a href=\"http://job.hdu.edu.cn\" rel=\"noopener\" target=\"_blank\">http://job.hdu.edu.cn</a>）进行邮箱验证，验证码有效期五分钟，请尽快完成验证！</p>\n" +
            "                                <p>验证码为：<b>{}</b></p>\n" +
            "                                <p>时间：<span style=\"border-bottom: 1px dashed rgb(204, 204, 204); position: relative;\" t=\"5\" times=\" 14:13\" isout=\"0\">{}</span> {}</p>\n" +
            "                                <p><span style=\"color:red\"><b>备注：</b>若非本人操作请忽略该邮件</span></p>\n" +
            "\n" +
            "<style type=\"text/css\">.qmbox style, .qmbox script, .qmbox head, .qmbox link, .qmbox meta {display: none !important;}</style></div></div>";
    String DEFAULT_PASSWORD = "root";
    Long EMAIL_TIME_OUT = 5 * 60 * 1000L;//邮箱验证码过期时间

    /**
     * 传入生成的随机验证码生成邮箱报文
     *
     * @param code
     * @return
     */
    static String getEmailHtml(String code) {
        return StrUtil.format(Constants.emailContext, code, LocalDate.now(), new SimpleDateFormat("HH:mm:ss").format(new Date()));
    }

    // long JWT_TIME_OUT = 30 * 60 * 1000L; //token过期时间
}
